<template>
  <div class="container">
    <div class="result">      
      <img v-if="fileSpace && resType === 1" :src="fileSpace + '/images/success-pic.jpg'" alt="">
      <img v-if="fileSpace && resType === -1" :src="fileSpace + '/images/error-pic.jpg'" alt="">
      <h1 v-if="resTitle">{{ resTitle }}</h1>
      <p>{{ resText }}</p>
    </div>
    <!-- 主播弹窗 -->
    <div class="dialog-wrap">
      <van-dialog :show="applyLiveShow" title="申请成为主播" use-slot show-cancel-button
        @close="onClose('applyLiveShow')" @confirm="applyLiveConfirm"
        cancelButtonText="跳过" confirmButtonText="确认申请">
        <div class="pad-l-25 pad-r-25 pad-b-13 mar-t-13" catchtouchmove="true">
          <div class="flex flex-between apply-info">
            <div>我的微信号</div>
            <input type="text">
          </div>
          <div class="explain">注：微信号用于您直播间开播和查询收入使用除此之外 系统不会对外透露，成为主播后无法修改微信号。</div>
        </div>
      </van-dialog>
    </div>
  </div>
</template>

<script>
  import {
    parseShortCode, addApply, storeCardApply, doBindMemberRecruiter,
    checkRecruiterStandardWxaCode, doBindNatureInMember,
    checkStandardNatureInWxaCode, getAppInfo, doMemberRecruit
  } from '@/api/common'
  import { getMemberInfo, submitCommanderBindMember } from '@/api/home'
  import { addEnterpriseShopApplyRecord } from '@/api/personal'
  import { getAuth } from '@/api/login'
  import { setToken, setCustomerId, setPhone, setVeekrayStatus, setMemberId } from '@/utils/auth'
  import { appColor } from '@/api/appColor'

  export default {
    data() {
      return {
        isComponents: true,
        paramsData: {},
        resType: '',
        resArrTxt: [],
        resTitle: '',
        resText: '',
        appInfo: {},
        scanCode: {},
        applyLiveShow: false,
        veekrayStatus: null,
        activeCodeData: {}
      }
    },
    onLoad(options) {
      console.log('扫小程序码进入')
      this.$pt.setStorageSync('scanIn', true)
      if (this.$pt.getStorageSync('scanCode')) {
        this.scanCode = this.$pt.getStorageSync('scanCode')
        if (this.scanCode && !options.scene) {
          options.scene = this.scanCode.scene
        }
      }
      if (options.scene) {
        this.scanCode.scene = options.scene
        // 扫小程序码进入
        let code = decodeURIComponent(options.scene)
        let params = {}
        getAppInfo().then((response) => {
          if (response.isError) return
          this.appInfo = response.data
          this.appInfo = appColor(response.data)
          parseShortCode(code).then((response) => {
            if (response.isError) {
              console.log('扫码', params)
              this.paramsData = params
              this.$utils.showToast({
                title: '二维码出错，请重新扫码！',
                duration: 3000
              })
              setTimeout(() => {
                this.$pt.reLaunch({ url: '/pages/home/main' })
              }, 3000)
              // if (this.getCustomerId) {
              //   this.$utils.setMyId(params.memberId)
              //   this.$root.$mp.appOptions.query = {}
              //   this.$pt.reLaunch({ url: '/pages/home/main' })
              // } else {
              //   this.wxLogin(this.paramsData)
              // }
              return
            }
            params = response.data
            console.log('params:', params)
            // 直播分享
            if (params.path === 'pages/home/live-share/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.paramsData.memberId = params.shareMemberId
              this.liveShare()
            }
            // C端运营商招募员二维码
            if (params.path === 'pages/code-page/main') {
              if (params.type === 2) {
                // C端运营商招募员二维码
                this.paramsData = params
                this.paramsData.scene = options.scene
                if (this.getCustomerId && this.getPhone) {
                  this.salesmanCode()
                } else {
                  this.$pt.setStorageSync('scanCode', this.paramsData)
                  this.wxLogin(this.paramsData)
                }
              } else if (params.type === 3) {
                this.paramsData = params
                if (this.getCustomerId) {
                  this.storeCode()
                } else {
                  this.wxLogin(this.paramsData)
                }
              }
            }
            // 扫码申请激活云店 (众项云企后台激活码 0213)
            if (params.path === 'pages/enterprise_shop_code/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.applyLiveShow = false
              this.veekrayStatus = null
              this.activeCodeData = {}
              if (this.getCustomerId && this.getPhone) {
                this.enterpriseActiveCode()
              } else {
                this.$pt.setStorageSync('scanCode', this.paramsData)
                this.wxLogin(this.paramsData)
              }
            }
            // 云企后台企业内部激活码  (添加内部微客码 0220)
            if (params.path === 'pages/standard-wxa-code-nature-in/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              if (this.getCustomerId && this.getPhone) {
                this.natureScan()
              } else {
                this.$pt.setStorageSync('scanCode', this.paramsData)
                this.wxLogin(this.paramsData)
              }
            }
            // 扫码申请企业微客 众项云企H5端  (添加外部微客码 0220)
            if (params.path === 'pages/enterprise_week_code/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              if (this.getCustomerId && this.getPhone) {
                this.enterpriseWeekCode()
              } else {
                this.$pt.setStorageSync('scanCode', this.paramsData)
                this.wxLogin(this.paramsData)
              }
            }
            // 名片首页
            if (params.path === 'pages/home/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              this.$pt.removeStorageSync('scanIn')
              if (this.getCustomerId) {
                this.scanHome(this.paramsData)
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 商品详情
            if (params.path === 'pages/shop/detail/main') {
              this.$pt.removeStorageSync('scanIn')
              this.$utils.setGetUserInfo(params)
              this.$utils.setMyId(params.memberId)
              if (!params.shareMemberId) {
                this.$pt.reLaunch({
                  url: '/pages/shop/detail/main?memberId=' + params.memberId + '&goodsId=' +
                  params.goodsId + '&goodsType=' + params.goodsType
                })
              } else {
                this.$pt.reLaunch({
                  url: '/pages/shop/detail/main?memberId=' + params.memberId + '&goodsId=' +
                  params.goodsId + '&goodsType=' + params.goodsType + '&shareMemberId=' + params.shareMemberId
                })
              }
            }
            // 文章详情
            if (params.path === 'pages/article/detail/main') {
              this.$utils.setGetUserInfo(params)
              this.$utils.setMyId(params.memberId)
              this.$pt.reLaunch({
                url: '/pages/article/detail/main?memberId=' + params.memberId + '&articleId=' + params.articleId + '&shareArticle=true'
              })
            }
            // 绑定业务员
            if (params.path === 'pages/home/bind-member/main') {
              this.$pt.reLaunch({
                url: '/pages/home/bind-member/main?employeeId=' + params.employeeId + '&token=' + params.token
              })
            }
            // 招募员标准码
            if (params.path === 'pages/recruit-standard-wxa-code/main') {
              this.paramsData = params
              // 招募员码
              if (this.getCustomerId) {
                this.standardScan()
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 核销员邀请码
            if (params.path === 'pages/personal/cancellation-scanning/main') {
              this.paramsData = params
              if (this.getCustomerId) {
                this.$pt.reLaunch({
                  url: '/pages/personal/cancellation-desk/writer-invitation/main?memberId=' + params.memberId + '&nickName=' + params.nickname
                })
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 社群自营商品扫码核销
            if (params.path === 'pages/personal/cancellation-desk/order-cancellation/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.$pt.reLaunch({ url: '/pages/home/cancellation-desk/order-cancellation/main?orderId=' + params.orderId })
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 自定义预览页面
            if (params.path === 'pages/home/custom-preview/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.customPreview()
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 团长申请页
            if (params.path === 'pages/home/villageCommander/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.$pt.reLaunch({ url: '/pages/home/main' })
              } else {
                // 没有授权，前往授权
                this.goLogin(this.paramsData)
                // this.wxLogin(this.paramsData)
              }
            }
            // 门店申请页
            if (params.path === 'pages/home/storeManage/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.$pt.reLaunch({ url: '/pages/home/main' })
              } else {
                // 没有授权，前往授权
                this.goLogin(this.paramsData)
                // this.wxLogin(this.paramsData)
              }
            }
            // 团长扫码核销 订单列表页
            if (params.path === 'pages/home/store-cancellation/orders-cancellation/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.$pt.reLaunch({ url: '/pages/home/store-cancellation/orders-cancellation/main?memberId=' + params.memberId })
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 团长扫码核销 订单详情页
            if (params.path === 'pages/home/store-cancellation/order-cancellation/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.$pt.reLaunch({ url: '/pages/home/store-cancellation/order-cancellation/main?memberId=' + params.memberId + '&orderId=' + params.orderId })
              } else {
                this.wxLogin(this.paramsData)
              }
            }
            // 团长激活
            if (params.path === 'pages/home/bindCommander/main') {
              this.paramsData = params
              this.paramsData.scene = options.scene
              this.$pt.setStorageSync('scanCode', this.paramsData)
              if (this.getCustomerId) {
                this.bindCommander()
              } else {
                // 没有授权，前往授权
                this.goLogin(this.paramsData)
              }
            }
          }).catch(() => {
          })
        }).catch(() => {
        })
      }
    },
    methods: {
      resTxtEls(resMsg) {
        this.resType = -1
        if (resMsg.indexOf('，') !== -1) {
          this.resArrTxt = resMsg.split('，')
          this.resTitle = this.resArrTxt[0]
          this.resText = this.resArrTxt[1]
        } else {
          this.resText = resMsg
        }
        return false
      },
      // 扫码个人主页码
      scanHome(params) {
        setMemberId(params.memberId)
        this.$utils.setGetUserInfo(params)
        this.$utils.setMyId(params.memberId)
        this.$root.$mp.appOptions.query = {}
        this.$pt.removeStorageSync('scanCode')
        this.$pt.reLaunch({ url: '/pages/home/main' })
      },
      liveShare() {
        setMemberId(this.paramsData.shareMemberId)
        this.$utils.setMyId(this.paramsData.shareMemberId)
        this.$root.$mp.appOptions.query = {}
        this.$pt.reLaunch({
          url: '/pages/home/live-share/main?shareMemberId=' + this.paramsData.shareMemberId +
           '&roomid=' + this.paramsData.roomId + '&shareType=1'
        })
      },
      // 自定义预览页面
      customPreview() {
        if (!this.getCustomerId) {
          setTimeout(() => {
            this.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 300)
          return
        }
        getMemberInfo(this.getCustomerId).then((response) => {
          if (response.isError) return
          if (response.data.veekrayStatus === 1) {
            setMemberId(this.getCustomerId)
            this.$utils.setMyId(this.getCustomerId)
            setVeekrayStatus(response.data.veekrayStatus)
          } else {
            setMemberId(this.appInfo.defaultMemberId)
            this.$utils.setMyId(this.appInfo.defaultMemberId)
          }
          this.$pt.removeStorageSync('scanCode')
          let that = this
          setTimeout(() => {
            that.$pt.reLaunch({
              url: '/pages/home/custom-preview/main?params=' + JSON.stringify(that.paramsData)
            })
          }, 800)
        })
      },
      natureScan() {
        if (!this.getCustomerId || !this.getPhone) {
          setTimeout(() => {
            this.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 300)
          return
        }
        doBindNatureInMember({
          enterpriseId: this.paramsData.enterpriseId,
          memberId: this.getCustomerId
        }).then((response) => {
          this.$pt.hideToast()
          const doBindRes = response
          getMemberInfo(this.getCustomerId).then((response) => {
            if (response.isError) return
            setVeekrayStatus(response.data.veekrayStatus)
            if (response.data.veekrayStatus === 1) {
              setMemberId(this.getCustomerId)
              this.$utils.setMyId(this.getCustomerId)
            } else {
              setMemberId(this.appInfo.defaultMemberId)
              this.$utils.setMyId(this.appInfo.defaultMemberId)
            }
            if (doBindRes.isError) {
              this.resTxtEls(doBindRes.errorMsg)
              return
            }
            checkStandardNatureInWxaCode({
              enterpriseId: this.paramsData.enterpriseId,
              memberId: this.getCustomerId
            }).then((response) => {
              this.$pt.hideToast()
              if (response.isError) {
                this.resTxtEls(response.errorMsg)
                return
              }
              this.$pt.removeStorageSync('scanCode')
              if (response.data.type === 0) {
                this.resType = -1
                this.resTitle = '扫码出错'
                this.resText = '请重新扫码'
              } else if (response.data.type === 1) {
                this.resType = 1
                this.resTitle = '申请成功'
                this.resText = '恭喜你成为微客'
              }
            }).catch(() => {
            })
          }).catch(() => {
          })
        }).catch(() => {
        })
      },
      enterpriseWeekCode() {
        if (!this.getCustomerId || !this.getPhone) {
          setTimeout(() => {
            this.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 300)
          return
        }
        getMemberInfo(this.getCustomerId).then((response) => {
          if (response.isError) return
          setVeekrayStatus(response.data.veekrayStatus)
          if (response.data.veekrayStatus === 1) {
            setMemberId(this.getCustomerId)
            this.$utils.setMyId(this.getCustomerId)
          } else {
            setMemberId(this.appInfo.defaultMemberId)
            this.$utils.setMyId(this.appInfo.defaultMemberId)
          }
          let params = {
            nature: this.paramsData.type,
            recruiterId: this.paramsData.recruiterId,
            enterpriseId: this.paramsData.enterpriseId,
            memberId: this.getCustomerId
          }
          doMemberRecruit(params).then(response => {
            if (response.isError) {
              let that = this
              this.$utils.showToast({ title: response.errorMsg })
              setTimeout(() => {
                that.$pt.reLaunch({
                  url: '/pages/home/main'
                })
              }, 2000)
            } else {
              this.$pt.removeStorageSync('scanCode')
              if (response.data === 0) {
                this.resType = -1
                this.resText = '您已是公共微客'
              } else if (response.data === 1) {
                this.resType = -1
                this.resText = '您已是外部微客'
              } else if (response.data === 2) {
                this.resType = -1
                this.resText = '您已是内部微客'
              } else if (response.data === 3) {
                this.resType = 1
                this.resTitle = '申请成功'
                this.resText = '恭喜你成为微客'
              }
            }
          })
        }).catch(() => {
        })
      },
      salesmanCode() {
        if (!this.getCustomerId || !this.getPhone) {
          setTimeout(() => {
            this.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 300)
          return
        }
        getMemberInfo(this.getCustomerId).then((response) => {
          if (response.isError) return
          let veekrayStatus = response.data.veekrayStatus
          addApply({
            memberId: this.getCustomerId,
            agentId: this.paramsData.agentId,
            employeeId: this.paramsData.employeeId
          }).then((response) => {
            if (response.isError) {
              let that = this
              this.$utils.showToast({ title: response.errorMsg })
              setTimeout(() => {
                that.$pt.reLaunch({
                  url: '/pages/home/main'
                })
              }, 2000)
            } else {
              this.$utils.setMyId(this.appInfo.defaultMemberId)
              this.$root.$mp.appOptions.query = {}
              this.$pt.removeStorageSync('scanCode')
              if (response.data === 4) {
                // 4为未实名认证 跳转到实名认证页面
                this.$pt.reLaunch({
                  url: '/pages/personal/bank-card/main?pageFrom=list'
                })
              } else {
                this.$pt.reLaunch({
                  url: '/pages/personal/apply-for/main?salesmanType=' + response.data + '&veekrayStatus=' + veekrayStatus
                })
              }
            }
          }).catch(() => {
          })
        }).catch(() => {
        })
      },
      // (众项云企后台激活码) 云企云店开通 0818
      enterpriseActiveCode() {
        if (!this.getCustomerId || !this.getPhone) {
          setTimeout(() => {
            this.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 300)
          return
        }
        getMemberInfo(this.getCustomerId).then((response) => {
          if (response.isError) return
          this.veekrayStatus = response.data.veekrayStatus
          // 众项云企H5端 vip申请
          let params = {
            nature: this.paramsData.source,
            recruiterId: this.paramsData.recruiterId ? this.paramsData.recruiterId : '',
            enterpriseId: this.paramsData.enterpriseId,
            memberId: this.getCustomerId
          }
          console.log('777 params', params)
          addEnterpriseShopApplyRecord(params).then(response => {
            if (response.isError) {
              let that = this
              this.$utils.showToast({ title: response.errorMsg })
              setTimeout(() => {
                that.$pt.reLaunch({
                  url: '/pages/home/main'
                })
              }, 2000)
            } else {
              this.activeCodeData = response.data
              this.$utils.setMyId(this.appInfo.defaultMemberId)
              this.$root.$mp.appOptions.query = {}
              this.$pt.removeStorageSync('scanCode')
              this.$pt.removeStorageSync('scanIn')
              this.$pt.reLaunch({
                url: '/pages/order/apply-for/main?enterpriseType=' + this.activeCodeData + '&veekrayStatus=' + this.veekrayStatus
              })
            }
          })
        }).catch(() => {
        })
      },
      standardScan() {
        doBindMemberRecruiter({
          enterpriseId: this.paramsData.enterpriseId,
          recruiterId: this.paramsData.recruiterId,
          memberId: this.getCustomerId
        }).then((response) => {
          this.$pt.hideToast()
          if (response.isError) {
            this.resTxtEls(response.errorMsg)
            return
          }
          checkRecruiterStandardWxaCode({
            enterpriseId: this.paramsData.enterpriseId,
            recruiterId: this.paramsData.recruiterId,
            memberId: this.getCustomerId
          }).then((response) => {
            this.$pt.hideToast()
            if (response.isError) {
              this.resTxtEls(response.errorMsg)
              return
            }
            this.$pt.removeStorageSync('scanCode')
            if (response.data.type === '0') {
              this.$pt.reLaunch({
                url: '/pages/home/buy/main?urlFrom=recruiter&urlEnterpriseId=' + this.paramsData.enterpriseId +
                '&urlrecruiterId=' + this.paramsData.recruiterId
              })
            } else if (response.data.type === '1') {
              this.resType = -1
              this.resTitle = '激活码不足！'
              this.resText = '请充值后重新扫码开通'
            } else if (response.data.type === '2') {
              this.resType = 1
              this.resTitle = '您已开通，请勿重复操作！'
            }
          }).catch(() => {
          })
        }).catch(() => {
        })
      },
      storeCode() {
        let data = {
          memberId: this.getCustomerId,
          enterpriseId: this.paramsData.enterpriseId,
          source: this.paramsData.source
        }
        if (this.paramsData.recruiterId) {
          data.recruitId = this.paramsData.recruiterId
        }
        storeCardApply(data).then((response) => {
          // console.log(response)
          if (response.isError) {
            this.$utils.showToast({ title: response.errorMsg })
          } else {
            this.$utils.showToast({ title: response.msg })
          }
          let that = this
          setTimeout(() => {
            that.$pt.reLaunch({
              url: '/pages/home/main'
            })
          }, 2000)
        }).catch(() => {
        })
      },
      bindCommander() {
        let scanCode = this.$pt.getStorageSync('scanCode')
        submitCommanderBindMember({
          memberId: this.getCustomerId,
          enterpriseId: scanCode.enterpriseId,
          commanderId: scanCode.commanderId
        }).then(response => {
          if (response.isError) {
            this.$pt.reLaunch({ url: '/pages/home/apply-result/main?memberId=' + this.getCustomerId + '&phone=' + this.phone + '&bindStatus=2&msg=' + response.errorMsg })
            return
          }
          this.$pt.reLaunch({ url: '/pages/home/apply-result/main?memberId=' + this.getCustomerId + '&phone=' + this.phone + '&bindStatus=1&msg=' + response.msg })
        }).catch(() => {
        })
      },
      goLogin(obj) {
        if (obj.path === 'pages/home/storeManage/main') {
          // 门店身份申请
          // 缓存门店申请标志
          this.$pt.setStorageSync('store-apply', true)
          // 移除社区团长申请标志
          this.$pt.removeStorageSync('leader-apply')
        } else if (obj.path === 'pages/home/villageCommander/main') {
          // 缓存社区团长申请标志
          this.$pt.setStorageSync('leader-apply', true)
          // 移除门店申请申请标志
          this.$pt.removeStorageSync('store-apply')
        } else if (obj.path === 'pages/home/bindCommander/main') {
          // 缓存激活团长
          this.$pt.setStorageSync('bindCommander', true)
        }
        // 跳到首页，首页有权限拦截，判断各种权限
        this.$pt.reLaunch({ url: '/pages/home/main' })
      },
      wxLogin(obj) {
        const that = this
        that.$utils.showToast({
          title: '加载中',
          icon: 'loading',
          duration: 3000
        })
        that.$pt.login({
          success(res) {
            if (res.code) {
              console.log('employee-login:' + res.code)
              getAuth(res.code).then((response) => {
                if (response.isError) return
                if (!response.data.customerId) {
                  console.log('!customerId')
                  // that.$utils.showToast({ title: '请先授权，再进行绑定！' })
                  setTimeout(() => {
                    if (obj.memberId) {
                      setMemberId(obj.memberId)
                      that.$utils.setMyId(obj.memberId)
                      that.$root.$mp.appOptions.query = {}
                    }
                    that.$pt.reLaunch({ url: '/pages/home/main' })
                  })
                  return
                }
                setToken(response.data.token)
                setCustomerId(response.data.customerId)
                if (response.data.phone) {
                  setPhone(response.data.phone)
                }
                setVeekrayStatus(response.data.veekrayStatus)
                // 关闭loading
                that.$pt.hideToast()
                if (obj.type === 2) {
                  that.salesmanCode()
                } else if (obj.type === 3) {
                  that.storeCode()
                }
                if (obj.cardSource === 1) {
                  that.natureScan()
                } else if (obj.cardSource === 2) {
                  that.standardScan()
                }
                if (obj.path === 'pages/personal/cancellation-desk/order-cancellation/main') {
                  // 判断是否社群自营商品扫码核销
                  that.$pt.reLaunch({ url: '/pages/personal/cancellation-desk/order-cancellation/main?orderId=' + obj.orderId })
                }
                if (obj.path === 'pages/enterprise_shop_code/main') {
                  // 判断是否来自扫萤火云店激活码
                  that.enterpriseActiveCode()
                }
                if (obj.path === 'pages/enterprise_week_code/main') {
                  // 判断是否来自扫众项云企H5端 招募微客
                  that.enterpriseWeekCode()
                }
                if (obj.path === 'pages/home/custom-preview/main') {
                  // 判断是否来自扫码自定义
                  that.customPreview()
                }
                if (obj.path === 'pages/home/main') {
                  // 判断是否来扫码个人主页
                  that.scanHome(obj)
                }
                if (obj.path === 'pages/home/live-share/main') {
                  // 判断是否直播分享
                  that.liveShare()
                }
              }).catch(() => {
              })
            } else {
              that.$utils.showToast({ title: '登录失败' })
            }
          }
        })
      },
      onClose(value) {
        // 申请主播相关关闭按钮
        this[value] = false
        setTimeout(() => {
          this.goApplyForPage()
        }, 800)
      },
      applyLiveConfirm() {
        // 申请主播确认提交信息按钮
        // this.$utils.showToast({ title: '不能大于商品库存' })
        this.applyLiveShow = false
        setTimeout(() => {
          this.goApplyForPage()
        }, 800)
      },
      goApplyForPage() {
        this.$pt.reLaunch({
          url: '/pages/personal/apply-for/main?enterpriseType=' + this.activeCodeData + '&veekrayStatus=' + this.veekrayStatus
        })
      }
    }
  }
</script>

<style lang="less" scoped>
.container {
  display: flex;
  justify-content: center;
  background: #ffffff;
  min-height: calc(100vh);
  .result {
    margin-top: 88px;
  }
  image {
    width: 324px;
    height: 165px;
  }
  h1 {
    display: flex;
    justify-content: center;
    font-size: 22px;
    text-align: center;
    margin-top: 10px;
    color: #000000;
  }
  p {
    font-size: 18px;
    margin-top: 10px;
    padding: 0 15px;
    text-align: center;
    color: #666666;
  }
  .dialog-wrap{
    /deep/ .van-popup{
      border-radius: 16px;
      .van-dialog__header{
        padding-top: 20px;
      }
    }
    .apply-info{
      background-color: #eee;
      height: 40px;
      font-size: 14px;
      padding: 0 10px 0;
      input{
        background-color: white;
        text-align: right;
        padding: 0 5px;
      }
    }
    .explain{
      color: #9A9A9A;
      font-size: 10px;
      margin: 8px auto 0;
      line-height: 15px;
    }
  }
}
</style>

